<?PHP	
	require 'CURL.php';
	require 'config.php';
	
	$UID = $_GET['uid'];	
	$Method = $_GET['method'];
	$ParamsString = $_GET['params'];
	$Token = $_GET['access_token'];
	$VKApi = 'https://api.vk.com/';
	
	$ParamsArray = explode(';', $ParamsString);
	$ParamsResult = '';	
	$count = count($ParamsArray);
	
	for ($i = 0; $i < $count; $i++) 
	{
		$Param = explode(',', $ParamsArray[$i]);
		$ParamsResult =  $ParamsResult . '&' . $Param[0] . '=' . $Param [1];
	}
	
	$Request = $VKApi . 'method/' . $Method . '?uid=' . $UID . $ParamsResult . '&client_secret=' . $VKAppKey . '&access_token=' . $Token;
	
	$curl = new CURL();	
	$opts = array
	(
		CURLOPT_RETURNTRANSFER => true, 
		CURLOPT_FOLLOWLOCATION => true,
		CURLOPT_SSL_VERIFYHOST	=> false,
		CURLOPT_SSL_VERIFYPEER	=> false
	);	
	$curl->addSession($Request, $opts);
	$result = $curl->exec();	
	echo $result;
	
	$curl->clear();	
?>